Skip to content

Conversation

@sgindeed
Copy link
Contributor

@sgindeed sgindeed commented Oct 8, 2025

  1. Prompts the user to enter a string.
  2. Converts the string to lowercase (optional, for case-insensitive processing).
  3. Splits the string into individual characters.
  4. Uses a hash table to track the last seen index of each character.
  5. Implements a sliding window to find substrings without repeating characters.
  6. Computes and updates the length of the longest substring found.
  7. Displays the length of the longest substring without repeating characters.

@sgindeed sgindeed requested review from acylam and siriak as code owners October 8, 2025 08:16
@siriak siriak requested a review from Copilot October 8, 2025 12:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an R program that finds the length of the longest substring without repeating characters using a sliding window algorithm. The program prompts for user input, processes the string character by character, and uses a hash table to track character positions.

  • Implements sliding window algorithm with hash table for character tracking
  • Includes user input handling and case-insensitive processing
  • Provides clear output showing the longest substring length

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit 72ad1cc into TheAlgorithms:master Oct 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants